home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume91 / libraris / sregexp9 / part01 / utils / remlib.c < prev    next >
C/C++ Source or Header  |  1991-05-18  |  523b  |  32 lines

  1.  
  2. #include <exec/types.h>
  3. #include <exec/libraries.h>
  4. #include <clib/exec_protos.h>
  5. #include <exec/execbase.h>
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8.  
  9. extern struct ExecBase *SysBase;
  10.  
  11. int
  12. main(ac,av)
  13. int ac;
  14. char **av;
  15. {
  16.     struct Library *found;
  17.  
  18.     if (ac != 2) {
  19.     puts("Use: remlib <library name>");
  20.     return 10;
  21.     }
  22.  
  23.     Forbid();
  24.     if (found = (struct Library *)FindName(&SysBase->LibList,av[1]))
  25.     RemLibrary(found);
  26.     Permit();
  27.     if (!found)
  28.     return 5;
  29.     puts("OK, hopefully it is gone.");
  30.     return 0;
  31. }
  32.